<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form id="f1" th:action="@{/emp}" th:object="${emp}" method="post">
    <h1 th:if="${emp.id == null}">添加员工</h1>
    <div th:if="${emp.id!=null}">
        <h1>修改员工</h1>
        <input type="hidden" th:field="*{id}">
        <input type="hidden" name="_method" value="PUT">
    </div>
    <p>姓名：<input type="text" th:field="*{name}"></p>
    <p>工资：<input type="text" th:field="*{sal}"></p>
    <p>性别：
        <span th:each="sex:${sexs}">
             <input type="radio" th:field="*{sex}" th:value="${sex.key}"/>
             <span th:text="${sex.value}">男</span>
        </span>
    </p>
    职位：<p><input type="text" th:field="*{jobDec}"></p>
    生日：<p><input type="text" th:field="*{birthday}"></p>
    <button>保存</button>

</form>
</body>
</html>